﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class Portal_ViewPicture:System.Web.UI.Page
{
	int nDocumentID = -1;
	protected void Page_Load(object sender,EventArgs e)
	{
		if(Request.Params["DocumentID"] != null)
		{
			if(Int32.TryParse(Request.Params["DocumentID"].ToString(),out nDocumentID) == false)
			{
				return;
			}
			if(nDocumentID > 0)
			{
				ShowPicture(nDocumentID);
			}
		}
	}

	private void ShowPicture(int nDocumentID)
	{
		IDocument doc = new Document();
		SqlDataReader dr = doc.GetSingleDocument(nDocumentID);

		if(dr.Read())
		{
			pic.Src = "../" + dr["Url"].ToString();
		}
		dr.Close();
	}
}
